package com.yssw.client.service.impl;

import java.util.List;

import com.yssw.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.yssw.client.mapper.UserServiceLogMapper;
import com.yssw.client.domain.UserServiceLog;
import com.yssw.client.service.IUserServiceLogService;

/**
 * 维修记录Service业务层处理
 *
 * @author yssw
 * @date 2023-04-01
 */
@Service
public class UserServiceLogServiceImpl implements IUserServiceLogService {
    @Autowired
    private UserServiceLogMapper userServiceLogMapper;

    /**
     * 查询维修记录
     *
     * @param id 维修记录主键
     * @return 维修记录
     */
    @Override
    public UserServiceLog selectUserServiceLogById(Long id) {
        return userServiceLogMapper.selectUserServiceLogById(id);
    }

    /**
     * 查询维修记录列表
     *
     * @param userServiceLog 维修记录
     * @return 维修记录
     */
    @Override
    public List<UserServiceLog> selectUserServiceLogList(UserServiceLog userServiceLog) {
        return userServiceLogMapper.selectUserServiceLogList(userServiceLog);
    }

    /**
     * 新增维修记录
     *
     * @param userServiceLog 维修记录
     * @return 结果
     */
    @Override
    public int insertUserServiceLog(UserServiceLog userServiceLog) {
        userServiceLog.setCreateTime(DateUtils.getNowDate());
        return userServiceLogMapper.insertUserServiceLog(userServiceLog);
    }

    /**
     * 修改维修记录
     *
     * @param userServiceLog 维修记录
     * @return 结果
     */
    @Override
    public int updateUserServiceLog(UserServiceLog userServiceLog) {
        userServiceLog.setUpdateTime(DateUtils.getNowDate());
        return userServiceLogMapper.updateUserServiceLog(userServiceLog);
    }

    /**
     * 批量删除维修记录
     *
     * @param ids 需要删除的维修记录主键
     * @return 结果
     */
    @Override
    public int deleteUserServiceLogByIds(Long[] ids) {
        return userServiceLogMapper.deleteUserServiceLogByIds(ids);
    }

    /**
     * 删除维修记录信息
     *
     * @param id 维修记录主键
     * @return 结果
     */
    @Override
    public int deleteUserServiceLogById(Long id) {
        return userServiceLogMapper.deleteUserServiceLogById(id);
    }
}
